lpr: Fix various compiler warnings
authorMatthias Clasen <mclasen@redhat.com>
Wed, 17 Mar 2021 11:56:07 +0000 (07:56 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 17 Mar 2021 11:56:07 +0000 (07:56 -0400)
gcc 11 is warning about some const mixups here.
Fix them.

modules/printbackends/gtkprintbackendlpr.c

index 17ed4fbf3f0056af9e7076152572d63ffa8e2298..ea7770f5a9c2e72f78ec32635f4af6180e7c7c1a 100644 (file)
@@ -103,7 +103,7 @@ char **
 g_io_module_query (void)
 {
   char *eps[] = {
-    GTK_PRINT_BACKEND_EXTENSION_POINT_NAME,
+    (char *)GTK_PRINT_BACKEND_EXTENSION_POINT_NAME,
     NULL
   };
 
@@ -399,13 +399,12 @@ lpr_printer_get_options (GtkPrinter           *printer,
   GtkPrinterOptionSet *set;
   GtkPrinterOption *option;
   const char *command;
-  char *n_up[] = {"1", "2", "4", "6", "9", "16" };
+  const char *n_up[] = {"1", "2", "4", "6", "9", "16" };
 
   set = gtk_printer_option_set_new ();
 
   option = gtk_printer_option_new ("gtk-n-up", _("Pages Per Sheet"), GTK_PRINTER_OPTION_TYPE_PICKONE);
-  gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up),
-                                         (char **)n_up, (char **)n_up);
+  gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up), n_up, n_up);
   gtk_printer_option_set (option, "1");
   gtk_printer_option_set_add (set, option);
   g_object_unref (option);